﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Messaging.Messages;
using CommunityToolkit.Mvvm.Messaging;
using MyWpfFramework.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace MyWpfFramework.ViewModels
{
    public partial class UserViewModel : ObservableRecipient, IRecipient<ValueChangedMessage<DemoDataModel>>
    {
        [ObservableProperty]
        private User users=new User { UserName="张三",UserID=1};

        public void Receive(ValueChangedMessage<DemoDataModel> message)
        {
            MessageBox.Show(message.Value.Name);
        }
    }
}
